package com.cc.blog.admin.controller;

import com.cc.blog.admin.service.AdminFileService;
import com.cc.blog.common.annotation.ApiOperationLog;
import com.cc.blog.common.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Author cc
 * @Date 2024/7/11 9:51
 */
@RestController
@RequestMapping("/admin")
@Api(tags = "Admin 文件模块")
@AllArgsConstructor
public class AdminFileController {

    private final AdminFileService fileService;

    @PostMapping("/file/upload")
    @ApiOperation(value = "文件上传")
    @ApiOperationLog(description = "文件上传")
    public Result uploadFile(@RequestParam MultipartFile file) {
        return fileService.uploadFile(file);
    }
}
